package org.nstack.header.volume;

import org.nstack.header.message.APIMessage;
import org.nstack.header.message.APIParam;
import org.springframework.http.HttpMethod;
import org.nstack.header.identity.Action;
import org.nstack.header.rest.RestRequest;
import org.nstack.header.vm.VmInstanceVO;


@Action(category = VolumeConstant.ACTION_CATEGORY)
@RestRequest(
        path = "/volumes/{volumeUuid}/vm-instances/{vmInstanceUuid}",
        method = HttpMethod.POST,
        responseClass = APIAttachDataVolumeToVmEvent.class
)
public class APIAttachDataVolumeToVmMsg extends APIMessage implements VolumeMessage {

    @APIParam(resourceType = VmInstanceVO.class, checkAccount = true, operationTarget = true)
    private String vmInstanceUuid;

    @APIParam(resourceType = VolumeVO.class, checkAccount = true, operationTarget = true)
    private String volumeUuid;

    public String getVmUuid() {
        return vmInstanceUuid;
    }

    public void setVmUuid(String vmInstanceUuid) {
        this.vmInstanceUuid = vmInstanceUuid;
    }

    public void setVmInstanceUuid(String vmInstanceUuid) {
        this.vmInstanceUuid = vmInstanceUuid;
    }

    public String getVolumeUuid() {
        return volumeUuid;
    }


    public void setVolumeUuid(String volumeUuid) {
        this.volumeUuid = volumeUuid;
    }

    public String getVmInstanceUuid() {
        return getVmUuid();
    }
 
    public static APIAttachDataVolumeToVmMsg __example__() {
        APIAttachDataVolumeToVmMsg msg = new APIAttachDataVolumeToVmMsg();
        msg.setVolumeUuid(uuid());
        msg.setVmUuid(uuid());

        return msg;
    }

}
